<!doctype html>
<html lang="zh-CN">
<head>
    <link rel="stylesheet" href="css/awesome-bootstrap-checkbox.css"/>
    <meta charset="utf-8">
    <link rel="shortcut icon" href="/static/bg_img/favicon.ico">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="{{ url_for('static', filename='layui/css/layui.css') }}">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="canonical" href="https://getbootstrap.com/docs/3.4/examples/jumbotron/">

    <title>购物车列表</title>

    <!-- Bootstrap core CSS -->
    <link href="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.29/dist/css/bootstrap.min.css"
          rel="stylesheet">

    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <link href="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.29/assets/css/ie10-viewport-bug-workaround.css"
          rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.29/examples/jumbotron/jumbotron.css"
          rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.29/assets/js/ie-emulation-modes-warning.js"></script>


    <script type="text/javascript">
        //页面加载的时候,所有的复选框都是未选中的状态
        function checkOrCancelAll() {
            //1.获取checkbo的元素对象
            var chElt = document.getElementById("chElt");
            //2.获取选中状态
            var checkedElt = chElt.checked;
            console.log(checkedElt)
            //3.若checked=true,将所有的复选框选中,checked=false,将所有的复选框取消
            var allCheck = document.getElementsByName("list");
            //4.循环遍历取出每一个复选框中的元素
            //var mySpan=document.getElementById("mySpan");
            if (checkedElt) {
                //全选
                for (var i = 0; i < allCheck.length; i++) {
                    //设置复选框的选中状态
                    allCheck[i].checked = true;
                }
                //mySpan.innerHTML="取消全选";
            } else {
                //取消全选
                for (var i = 0; i < allCheck.length; i++) {
                    allCheck[i].checked = false;
                }
                //mySpan.innerHTML="全选";
            }
        }
    </script>
    <style>
        .line-limit-length {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
    </style>

</head>

<body>

<div class="container">
    {% for item in res %}
    <div class="row" style="height: 280px" id={{ item["book_id"] }}>

        <div class="col-md-2" >
           <center>
               <img src={{ item["img"] }} class="cover"/>
           </center>
        </div>
    <div class="row">

            <div class="col-md-7" style="box-shadow:inset 1px 0px 0px #444, inset 0px 0px 0px #444;height: 280px">
                <br>
                <p class="title"><h3>书名：{{ item["book_name"] }}</h3></p>
                <br><br>
                <p style="font-weight: bold">作者:{{ item["author"] }}</p><br><br>
                <div class="line-limit-length">{{ item["book_des" |safe] }}</div>
            </div>
            <div class="layui-btn-container">
            <button type="button" class="layui-btn layui-btn-primary layui-btn-sm"><i class="layui-icon"></i></button>
            </div>
        </div>
    </div>
    {% endfor %}
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"
        integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ"
        crossorigin="anonymous"></script>
<script>
    window.jQuery || document.write(
        '<script src="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.29/assets/js/vendor/jquery.min.js"><\/script>'
    )
</script>
<script src="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.29/dist/js/bootstrap.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.29/assets/js/ie10-viewport-bug-workaround.js"></script>
</body>
</html>
